﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ContinuousTestation.PresenterFirstDSL
{
    public partial class TypedElement
    {
        /// <summary>
        /// Returns the Type property as a string, unless the Type is set to UserDefinedValueType
        /// or UserDefinedReferenceType, in which case it returns the TypeName property.
        /// </summary>
        public string GetCalculatedTypeNameValue()
        {
            if (this.Type == TypeNameEnumeration.UserDefinedReferenceType
                || this.Type == TypeNameEnumeration.UserDefinedValueType)
            {
                return this.TypeName;
            }
            else
            {
                return this.Type.ToString();
            }
        }
    }
}
